<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="{$__PUBLIC__}/css/reset.css" rel="stylesheet" type="text/css" />
<link href="{$__PUBLIC__}/css/style.css" rel="stylesheet" type="text/css" />
<script src="{$__PUBLIC__}/js/jquery-1.3.2-vsdoc2.js" type="text/javascript"></script>
{literal}
<script type="text/javascript">
$(document).ready(function() {
//全选
$('#allck').bind('click',function () 
{
	 if($('#allck').attr("checked"))
	 {
		 $("input:checkbox").attr("checked",true);
		 }
	 else
	 {
		 $("input:checkbox").attr("checked",false);
		 }
   	});
//删除所选
$('#alldel').bind('click',function(){
	var id="";
	$("#list input:checked").each(function(){                
		id+=$(this).val()+',';
	});
	if(id=="")
	{
		alert("请选择要删除的数据！");
		return;
		}
	if(confirm('确定要删除吗？'))
	{
		$.ajax({
			type: "POST",{/literal}
			url:  "{$__URL__}/alldel",{literal}
			data: {id:id},
			success: function(data){
				if(data=="1")
				{
					alert("删除成功！");
					window.location.href="{/literal}{$__URL__}{literal}/get_list.html";
					}
				else{
					alert("删除失败！");
					}
				}
			});
		}
});
})
</script>
{/literal}
</head>
<body>
<div id="main_frameid" class="pad-10 display" style="_margin-right:-12px;_width:98.9%;">
<div class="col-2 lf mr10 col">
	<h6>{$lang.list}</h6>
	<div class="content">
	<div id="ltop">
    <span style="padding-left:0px;"><input id="allck" name="allck" type="checkbox" /> {$lang.all}</span>
    <a href="{$__URL__}/add.html">{$lang.add}</a>
    <a id="alldel">{$lang.del}</a>
    </div>
	<div class="bk20 hr"><hr /></div>
	<table id="list">
    {if $group}
    <tr id="category"><td width="5%" >类别：</td>
    <td colspan="8" >
    {foreach from=$group item=group}
    <a href="{$group.url}">[{$group.name}]</a>
    {/foreach}</td></tr>
    {/if}
    <tr>
    <td width="5%" >{$lang.choice}</td>
    <td width="5%">{$lang.number}</td>
    <td width="10%">{$lang.name}</td>
    <td width="15%">{$lang.email}</td>
    <td width="10%">{$lang.qq}</td>
    <td width="10%">{$lang.phone}</td>
    <td width="5%">{$lang.sex}</td>
    <td width="25%">{$lang.address}</td>
    <td width="15%" style="padding:0px; text-align:center" >{$lang.operation}</td>
    </tr>
    {if $list}
    {foreach from=$list item=list}
    <tr>
    <td><input name="ck" type="checkbox" value="{$list.id}" /></td>
    <td>{$list.id}</td>
    <td>{$list.name}</td>
    <td>{$list.email}</td>
    <td>{$list.qq}</td>
    <td>{$list.phone}</td>
    <td>{$list.sex}</td>
    <td>{$list.address}</td>
    <td style="padding:0px; text-align:center">
    <a href="{$__URL__}/detail-{$list.id}.html">{$lang.detail}</a> | 
    <a href="{$__URL__}/edit-{$list.id}.html">{$lang.edit}</a> | 
    <a href="{$__URL__}/del-{$list.id}.html">{$lang.del}</a>
    </td>
    </tr>
    {/foreach}
    <tr><td id="page" colspan="9" >{$page}</td></tr>
    {else}
    <tr><td colspan="9" style="text-align:center;">{$lang.no_data}</td></tr>
    {/if}
    </table>
	</div>
</div>
</div>
</body>
</html>